package com.example.demo.mapper;

import com.example.demo.entity.BookedOrders;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 护理预约订单表 Mapper 接口
 * </p>
 *
 * @author Mr.we
 * @since 2024-06-03
 */
@Mapper
public interface BookedOrdersMapper extends BaseMapper<BookedOrders> {
    //插入预约订单
    @Insert("INSERT INTO booked_orders(wbt_id,user_id,create_time) VALUES(#{wbt_id},#{userId},NOW())")
    int insertOrder(@Param("wbt_id")int wbt_id,@Param("userId") int userId);

    //删除预约订单
    @Update("UPDATE booked_orders SET flag = 0 WHERE borders_id = #{borderId}")
    int deleteOrder(@Param("borderId")int borderId);
}
